package com.ruoyi.project.applet.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.applet.mapper.PrizeHistoryMapper;
import com.ruoyi.project.applet.domain.PrizeHistory;
import com.ruoyi.project.applet.service.IPrizeHistoryService;

/**
 * 中奖记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-04
 */
@Service
public class PrizeHistoryServiceImpl implements IPrizeHistoryService 
{
    @Autowired
    private PrizeHistoryMapper prizeHistoryMapper;

    /**
     * 查询中奖记录
     * 
     * @param id 中奖记录ID
     * @return 中奖记录
     */
    @Override
    public PrizeHistory selectPrizeHistoryById(Long id)
    {
        return prizeHistoryMapper.selectPrizeHistoryById(id);
    }

    /**
     * 查询中奖记录列表
     * 
     * @param prizeHistory 中奖记录
     * @return 中奖记录
     */
    @Override
    public List<PrizeHistory> selectPrizeHistoryList(PrizeHistory prizeHistory)
    {
        return prizeHistoryMapper.selectPrizeHistoryList(prizeHistory);
    }

    /**
     * 新增中奖记录
     * 
     * @param prizeHistory 中奖记录
     * @return 结果
     */
    @Override
    public int insertPrizeHistory(PrizeHistory prizeHistory)
    {
        prizeHistory.setCreateTime(DateUtils.getNowDate());
        return prizeHistoryMapper.insertPrizeHistory(prizeHistory);
    }

    /**
     * 修改中奖记录
     * 
     * @param prizeHistory 中奖记录
     * @return 结果
     */
    @Override
    public int updatePrizeHistory(PrizeHistory prizeHistory)
    {
        return prizeHistoryMapper.updatePrizeHistory(prizeHistory);
    }

    /**
     * 批量删除中奖记录
     * 
     * @param ids 需要删除的中奖记录ID
     * @return 结果
     */
    @Override
    public int deletePrizeHistoryByIds(Long[] ids)
    {
        return prizeHistoryMapper.deletePrizeHistoryByIds(ids);
    }

    /**
     * 删除中奖记录信息
     * 
     * @param id 中奖记录ID
     * @return 结果
     */
    @Override
    public int deletePrizeHistoryById(Long id)
    {
        return prizeHistoryMapper.deletePrizeHistoryById(id);
    }
}
